FROM  harbor.airqualitychina.cn:2229/public/python-centos7:v1
RUN mkdir -p /data/deploy/server-api
RUN mkdir -p /data/deploy/logs

WORKDIR /data/deploy/server-api
COPY requirements.txt ./

RUN pip3 install --upgrade pip \
&& pip3 install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

COPY . .
EXPOSE 8181
CMD [ "/bin/bash", "docker_run.sh" ]

#
#
##debian的python镜像小
#FROM python:3.7.9-slim-buster
##centos的python镜像大
##FROM centos/python-38-centos7
##应用再容器中的部署目录
#WORKDIR /appName
#COPY requirements.txt ./
#RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
#COPY . .
##dev 或test 或 prod，区别所用配置环境
##ENV APP_ENV prod 以start_gunicorn 为准
#EXPOSE 8181
##gunicorn use:
#CMD [ "python", "start_gunicorn.py"]

#docker build -t songling/framework:v5 .    构建镜像
#docker run -u root -d -it -p 8181:8181  --name myFramework  songling/framework 启动镜像 -d 后台运行，gunicorn需要
#docker rmi songling/framework 删除镜像
#docker run -u root --rm -it -p 8181:8181  --name myFramework  songling/framework  启动镜像后随着后台关闭 --rm
#docker exec -it myFramework /bin/bash   进入容器内

#docker login https://harbor.airqualitychina.cn:2229/  用户密码，上传镜像到私服
#docker tag python:3.7.9-slim-buster harbor.airqualitychina.cn:2229/public/python:3.7.9-slim-buster   公司私服地址  public：基础镜像位置，ysrd ：项目镜像位置
#docker push harbor.airqualitychina.cn:2229/public/framework-python3.7:v1
#docker push harbor.airqualitychina.cn:2229/public/python:3.7.9-slim-buster
#docker login
#docker tag songling/framework:v5 songling/framework:v5
#docker push  songling/framework


